package opera1;

import book.Book;
import book.BookList;

import java.util.Scanner;

public class AddOperation implements IOperation{
    @Override
    public void doWork(BookList bookList) {
        Scanner input = new Scanner(System.in);
        System.out.println("请输入书名:");
        String name = input.nextLine(); //书名
        System.out.println("请输入类型:");
        String type = input.nextLine(); //类型
        System.out.println("请输入价格:");
        int price = input.nextInt(); //价格
        input.nextLine();
        System.out.println("请输入作者:");
        String autor = input.nextLine(); //作者
        Book newBook = new Book(name,autor,price,type);
        bookList.addBook(newBook);

    }
}
